package com.example.backend.service.impl;

import com.example.backend.mapper.FoodMapper;
import com.example.backend.pojo.Food;
import com.example.backend.service.FoodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FoodServiceImpl implements FoodService {
    @Autowired
    private FoodMapper foodMapper;

    @Override
    public List<Food> getall(Integer restaurantid) {
        return foodMapper.getall(restaurantid);
    }


    @Override
    public void relive(Integer foodid) {
        foodMapper.relive(foodid);
    }

    @Override
    public void delete(Integer foodid) {
        foodMapper.delete(foodid);
    }

    @Override
    public void update(Food food) {
        foodMapper.update(food);
    }

    @Override
    public void add(Food food) {

        foodMapper.add(food);

    }

    @Override
    public List<Food> getallcommend(String restaurantid) {
        return foodMapper.getallcommend(restaurantid);
    }

    @Override
    public void updatecommend(Integer commend, String foodid) {
        foodMapper.updatecommend(commend, foodid);
    }


}
